package project1;

public class book {
   private int bianhao;
    private String name;
    private double price;
    private int shuliang;
     int mai;
    public int  getBianhao() {
        return bianhao;
    }

    public void setBianhao(int bianhao) {
        this.bianhao = bianhao;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getShulian() {
        return shuliang;
    }

    public void setShulian(int shulian) {
        this.shuliang = shulian;
    }
    public void cost(int n)
    {   if(shuliang>0)
        shuliang=shuliang-n;
        else
        System.out.println("库存不足");
    }

    public book(int bianhao, String name, double price, int shuliang) {
        this.bianhao = bianhao;
        this.name = name;
        this.price = price;
        this.shuliang = shuliang;
    }
}
